package com.yn.xr.middleware.news.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.yn.core.service.impl.BaseServiceImpl;
import com.yn.xr.common.page.Page;
import com.yn.xr.middleware.news.service.NewsInfoService;
import com.yn.xr.news.dao.NewsInfoDao;
import com.yn.xr.news.mode.NewsInfo;

/**
 * 
 * @description:新闻模块操作实现类
 * @fileName:NewsCenterServiceImpl.java
 * @createTime:2015年5月5日 下午3:40:36
 * @author:wujun
 * @version 1.0.0
 * 
 */
public class NewsInfoServiceImpl extends BaseServiceImpl<NewsInfo, Integer>
		implements NewsInfoService {
	
	private static final long serialVersionUID = 6952762245672029453L;
	
	@Resource
	private NewsInfoDao newsInfoDao; // 新闻底层操作接口
	// 日志对象
	private static final Logger logger = LoggerFactory
			.getLogger(NewsInfoServiceImpl.class);

	@Override
	public NewsInfo queryNewsInfoById(Integer newsId) throws Exception {
		NewsInfo newsInfo = newsInfoDao.findById(newsId);
		return newsInfo;
	}

	@Override
	public Page<NewsInfo> queryNewsInfoPage(String hql,
			Object[] queryParams, int pageNum, int pageSize) throws Exception {
		Page<NewsInfo> pageResult = null;
		try {
			pageResult = this.page(pageSize, pageNum, hql, queryParams);

		} catch (Exception e) {
			e.printStackTrace();
			logger.error("NewsInfoServiceImpl's queryNewsInfoPage，新闻分页查询异常，异常信息：" ,e);
			throw e;
		}
		return pageResult;
	}

	@Override
	public Page<NewsInfo> queryNewsInfoRecommendTimePage(
			NewsInfo newsInfo, int pageNum, int pageSize) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public NewsInfo queryNewsInfoNext(Integer newsId, Integer type,
			Integer platformId) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public NewsInfo queryNewsInfoPrev(Integer newsId, Integer type,
			Integer platformId) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<NewsInfo> queryNewsInfoHeatRankList(Integer number,
			Integer platform, Integer type) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateBrowseNumber(NewsInfo newsInfo) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Page<NewsInfo> queryOtherNewsInfoPage(NewsInfo newsInfo,
			Integer pageNum, Integer pageSize, String newsId,
			String pageUpnewsId, String nextNewsId) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
